<html>
<head>
<title>bit.ly Url Shortening</title>
<script type="text/javascript">
var xhr = new XMLHttpRequest();
xhr.open("GET", "http://api.bitly.com/v3/shorten?login=subwiz&apiKey=R_8c314d5e8c6d33fa441ad5e80f69b0de&longUrl=http://fileit.in/p/390");
xhr.onreadystatechange = function() { 
    if(xhr.readyState == 4) { 
        if(xhr.status==200) {
            console.log("Shortened URL: ", JSON.parse(xhr.responseText).data.url);
        } else {
            console.log("Oops", xhr);
        }
    } 
}
xhr.send();
</script>
</head>
<body>

</body>
</html>